<div class="list">
	<span class="txt"><a class="ajax2" href="javascript:void(0);"></a></span>
    <table cellspacing="0" cellpadding="0" style="text-align:left;">
		<tr class="th">
            <th>ID</th>	
            <th>视频名称</th>
            <th>视频描述</th>
            <th>排序ID</th>
            <th>操作</th>
		</tr>
		<?php foreach($videos as $item):?>
		<tr class='bg'>
			<td width='100'><?php echo $item['id'];?></td>
			<td style='text-align:left;' width='200'><?php echo $item['title'];?></td>
			<td width='200'><?php echo mb_substr($item['description'],0,50,'utf8');?></td>
			<td width='100'><?php echo $item['sortID'];?></td>
			<td class='odd' width='100'>
				<a class='ajax' id='<?php echo $item['id'];?>' href='javascript:void(0);'>编辑</a>|
				<a class='del' id='<?php echo $item['id'];?>' href='javascript:void(0);' >删除</a>
			</td>
		</tr>
		<?php endforeach;?>
		<tr>
			<td colspan="5" height="30"><?php echo $page;?></td>
		</tr>
    </table>
</div>

<script type="text/javascript">
$(document).ready(function(){
	$(".bg:odd").css("background-color","#EDEDED");
	$(".ajax").mouseover(function(){
        id = $(this).attr('id');
        $(".ajax").wBox({requestType: "ajax",title:"视频修改",target:"<?php echo url('video/edit?id=')?>"+id});
    });
	$(".ajax2").mouseover(function(){
        id = $(this).attr('id');
        $(".ajax2").wBox({requestType: "ajax",title:"视频添加",target:"<?php echo url('video/add')?>"});
    });
	$(".del").click(function(){
		if(confirm("确认删除")){
			that = $(this);
			$.post("<?php echo url('video/del');?>",{id:that.attr('id')},function(data){
				if(data.s==1){
					that.parents('tr').remove();
				}else{
					alert(data.i);
				}
			});
		}
		return false;
		});	
});
</script>
